#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
  int num;
  int ret = scanf("%d",&num);
  printf("%d\n",getpid());
  pid_t pid;
  ret--;

  for(int i = 0;i < num;i++)
  {
    pid = fork();
    if(pid > 0)
    {
      printf("%d\n",pid);
      wait(NULL);
      break;
    }
  }
  return 0;
}
